﻿<%@ Page Title="" Language="C#" MasterPageFile="../master/faa.master" AutoEventWireup="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">  
    #fm{ margin:0; padding:10px 30px; }  
    .ftitle{ font-size:14px; font-weight:bold; padding:5px 0; margin-bottom:10px; border-bottom:1px solid #ccc; }  
    .fitem{ margin-bottom:5px; }  
    .fitem label{ display:inline-block; width:100px; }  
    .fitem input,textarea{ width:480px; }
    
    /* ***************************************
    ** Diff related styles
    *****************************************/    
    .diff table { border:1px solid #99ccff; }
    .diff table th { font-size: 14px; border:1px solid #99ccff; padding:3px; background-color:#eaf2ff; }
    .diff table td { font-size: 14px; border:1px solid #99ccff; padding:3px; }
    
    ins { font-size: 14px; background-color: #cfc; text-decoration:inherit; }
    del { font-size: 14px; color: #999; background-color:#FEC8C8; }
    ins.mod { font-size: 14px; background-color: #FFE1AC; }
</style>

<script type="text/javascript">
    $(function() {
        $('#dg').datagrid({
            width: 756,
            height: 210,
            nowrap: true,
            pagination: true,
            rownumbers: true,
            singleSelect: true,
            url: '/template_faa/handler/grid.ashx?view=jiyuanNRSHSub&s_id=0',
            columns: [[
                { field: 'xgId', title: '隐藏', width: 10, hidden: 'true' },
                { field: 'xgLogId', title: '隐藏', width: 10, hidden: 'true' },
                { field: 'xgType', title: '修改类型', width: 200 },
                { field: 'xgPerson', title: '修改人', width: 200 },
                { field: 'xgDate', title: '修改时间', width: 260 }
            ]],
            onDblClickRow: function() {
                var selected = $('#dg').datagrid('getSelected');
                if (selected) {
                    $('#dlg').dialog('open');
                    $('#dlg').dialog('refresh', 'jiyuanNRSHDlg.ashx?id='+selected.xgId+'&logid='+selected.xgLogId);
                }
            }
        });
    });

    function doApproval(choice) {
        var row = $('#dg').datagrid('getSelected');
        if (row.xgType == '删除') { aType = 'delete'; }
        else if (row.xgType == '修改') { aType = 'update'; }
        else { aType = 'insert'; }
        $.post('/template_faa/handler/ajax.ashx',
                                { action: aType, id: row.xgId, logid: row.xgLogId, view: 'jiyuanNRSH', option: choice },
                                function(result) {
                                    if (result.errorMsg) {
                                        $.messager.show({
                                            title: '错误',
                                            msg: result.errorMsg
                                        });
                                    } else {
                                        $('#dg').datagrid('reload');
                                        $('#tg').treegrid('reload');
                                        $('#dlg').dialog('close');
                                    }
                                }, 'json');
    }
</script>
 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <div class="clear  wide" id="bodyPadding">
        <!--左侧导航栏-->
        <div id="vNav">
            <ul class="Sle S2">
                <li>
                    <h4>基元信息</h4>
                    <ul>
                        <li><a href="jiyuanXM.aspx">浏览基元项目</a></li>
                    </ul>
                </li>
            </ul>
            <ul class="Sle S2">
                <li>
                    <h4>管理基元库</h4>
                    <ul>
                        <li><a href="jiyuanXMSH.aspx">审核基元项目</a></li>
                        <li><a class="here" href="jiyuanNRSH.aspx">审核基元内容</a></li>
                    </ul>
                </li>
            </ul>
        </div>
                
        <!--右上快速链接栏-->
        <div class="clear" id="breadcrumbs">
            <p>
                <a href="#">基元系统</a> <span>»</span> <a href="#">基元项目</a> <span>»</span> 添加基元项目
            </p>
        </div>
        
        <!--右下主体栏-->
        <div class="whiteSheet">
            <div class="content" id="content_01">
                <!-- 标题栏 -->
	            <h1 class="pageTitle">基元信息修改审核</h1>
	            <div class="demo-info">
		            <div class="demo-tip icon-tip"></div>
		            <div>选择修改的基元项目进行审核</div>
	            </div>
                
                <!-- 显示差异的弹出窗口 -->
                <div id="dlg" class="easyui-dialog" title="修改内容详细" style="width: 640px; height: 400px; padding: 10px" 
                    closed="true" buttons="#dlg-buttons"></div>
                <!-- 弹出窗口底部的按钮 -->
                <div id="dlg-buttons">  
                    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doApproval('true')">通过</a>  
                    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="doApproval('false')">拒绝</a> 
                </div>

                
                <!-- 列表部分 -->  
                <% var value = Context.Request["project"]; %>                
                <div class="easyui-panel" style="width:780px;height:600px;padding:10px">
                    <div class="easyui-layout" data-options="fit:true">
                        <div id="pn" data-options="region:'north',split:true" style="height:360px">
                            <!-- 列表的上半部分，显示包含变更点的所有基元内容 -->
                            <table id="tg" title="基元修改列表" class="easyui-treegrid" style="width:756px;height:350px"
                                data-options="  
                                    url: '/template_faa/handler/treegrid.ashx?view=jiyuanNRSH&project=<%=value %>',
                                    rowStyler: function(row){
                                        if (row.jyDelCount > 0)
                                        {
                                            return 'background-color:#FF3300;color:#fff;font-weight:bold;';
                                        }
                                        else if (row.jyUpdCount > 0)
                                        {
                                            return 'background-color:#FFFF66;color:#000;font-weight:bold;';
                                        }
                                        else if (row.jyNewFlag > 0)
                                        {
                                            return 'background-color:#00CC33;color:#fff;font-weight:bold;';
                                        }
                                    },    
                                    rownumbers: false,  
                                    pagination: false,  
                                    pageSize: 2,  
                                    pageList: [2,10,20],  
                                    idField: 'jyId',  
                                    treeField: 'jyName',
                                    onClickRow: function() {
                                        $('#dlg').dialog('close');
                                        var selected = $('#tg').datagrid('getSelected');
                                        if (selected){
                                            $('#dg').datagrid({url:'/template_faa/handler/grid.ashx',    
                                                                queryParams:{s_id:selected.jyId, view:'jiyuanNRSHSub' }
                                                                })                                            
                                        }
                                    },
                                    onDblClickRow: function() {
                                        $('#dlg').dialog('close');
                                        var selected = $('#tg').datagrid('getSelected');
                                        if (selected){
                                            $('#dg').datagrid({url:'/template_faa/handler/grid.ashx',    
                                                                queryParams:{s_id:selected.jyId, view:'jiyuanNRSHSub' }
                                                                })                                            
                                        }
                                    }  
                                ">  
                                <thead>  
                                    <tr>  
				                        <th field="jyName" width="160" editor="text">检查内容</th>
				                        <th field="jyContent" width="60" editor="text">检查方法</th>
				                        <th field="jyStandard" width="200" editor="text">检查标准</th>
				                        <th field="jyBasis" width="100" editor="text">依据</th>
				                        <th field="jyPenalizeRef" width="80" editor="text" >处罚参考</th>
				                        <th field="jyCreateDate" width="80" editor="text">创建日期</th>
				                        <th field="jyProjectId" width="10" editor="text" hidden="true">隐藏</th>
				                        <th field="jyId" width="10" editor="text" hidden="true">隐藏</th>
				                        <th field="jyParentId" width="10" editor="text" hidden="true">隐藏</th>
				                        <th field="jyNewFlag" width="10" editor="text" hidden="true">隐藏</th>
				                        <th field="jyDelCount" width="10" editor="text" hidden="true">隐藏</th>
				                        <th field="jyUpdCount" width="10" editor="text" hidden="true">隐藏</th>				            
                                    </tr>  
                                </thead>  
                            </table>                        
                        </div>
                        <!-- 列表的下半部分，显示修改履历的内容 -->
                        <div id="pc" data-options="region:'center'" style="height:250px">
                            <table id="dg"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
</asp:Content>
